//
//  GuideCell.m
//  HealthStarApp
//
//  Created by zhumuzhi on 2019/12/21.
//  Copyright © 2019 zhumuzhi. All rights reserved.
//

#import "GuideCell.h"

@interface GuideCell ()

@property (nonatomic, strong) UIImageView *imageView;

@end

@implementation GuideCell

- (void)setImage:(NSString *)image {
    _image = image;
    self.imageView.image = [UIImage imageNamed:image];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self configUI];
    }
    return self;
}

- (void)configUI {
    
    [self.contentView addSubview:self.imageView];
}

- (void)layoutSubviews {
    [super layoutSubviews];
 
    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
    
    [super layoutSubviews];

}

- (UIImageView *)imageView {
    if (!_imageView) {
        _imageView = [[UIImageView alloc] init];
        _imageView.contentMode = UIViewContentModeScaleAspectFill;
        _imageView.clipsToBounds = YES;  // 如果不加此句会有Bug
    }
    return _imageView;
}


@end
